From: Martin Rudalics Date: Mon, 19 Nov 2007 07:48:56 +0000 (+0000) Subject: (top-level): Deactivate clipboard-kill-region and X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~25762 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=c328399020e81d7b69c57d1df3363acbc4cf3f1b;p=emacs.git (top-level): Deactivate clipboard-kill-region and clipboard-yank when the buffer is read-only. --- diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index c05a4e66a9a..ca20f6182fc 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -504,11 +504,14 @@ A large number or nil slows down menu responsiveness." ;; These are alternative definitions for the cut, paste and copy ;; menu items. Use them if your system expects these to use the clipboard. -(put 'clipboard-kill-region 'menu-enable 'mark-active) +(put 'clipboard-kill-region 'menu-enable + '(and mark-active (not buffer-read-only))) (put 'clipboard-kill-ring-save 'menu-enable 'mark-active) (put 'clipboard-yank 'menu-enable - '(or (and (fboundp 'x-selection-exists-p) (x-selection-exists-p)) - (x-selection-exists-p 'CLIPBOARD))) + '(and (or (and (fboundp 'x-selection-exists-p) + (x-selection-exists-p)) + (x-selection-exists-p 'CLIPBOARD)) + (not buffer-read-only))) (defun clipboard-yank () "Insert the clipboard contents, or the last stretch of killed text."